package jp.sourceforge.akjrcp.dropsomething;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.ui.GenericParametersFieldEditor;

import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class FFMpegSettingPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
	public static final String EXPORT_KEYNAME="FFMpegConvert";
	public static final String EXPORT_FFMPEG_SETTINGS=EXPORT_KEYNAME+"."+FFMpegDropSomethingTab.SETTINGS;
	public static final String EXPORT_FFMPEG_SETTINGS_INDEX=EXPORT_KEYNAME+"."+FFMpegDropSomethingTab.SELECTION_INDEX;
	public static final String DROPFFMPEG_CUSTOM_COMMAND="drop_ffmpeg_customcommand";
	public FFMpegSettingPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("ffmpegsetting.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		GenericParametersFieldEditor parametersEditor=new GenericParametersFieldEditor(EXPORT_FFMPEG_SETTINGS,Messages.getString("ffmpegsetting.ffmpeg_settings"),getFieldEditorParent());
		parametersEditor.setOptionEditorClass(FFMpegOptionEditor.class);// i don know this is smart or not
		parametersEditor.setDialogWidth(720);
		parametersEditor.setDialogHeight(640);
		addField(parametersEditor);
    	
		
		addField(new StringFieldEditor(DROPFFMPEG_CUSTOM_COMMAND,Messages.getString("ffmpegsetting.custom_command"),getFieldEditorParent()));
	}

	public void init(IWorkbench workbench) {
		
	}

}
